USE [OctoNetApps]
GO

/****** Object:  Table [classified].[ClassifiedAdsAttributeValues]    Script Date: 05/25/2011 06:50:06 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [classified].[ClassifiedAdsAttributeValues](
	[ResourceID] [bigint] NOT NULL,
	[AdID] [bigint] NOT NULL,
	[AttributeID] [bigint] NOT NULL,
	[CategoryID] [bigint] NOT NULL,
	[AttributeValue] [tinyint] NOT NULL,
 CONSTRAINT [PK_ClassifiedAdsAttributeValues] PRIMARY KEY CLUSTERED 
(
	[ResourceID] ASC,
	[AdID] ASC,
	[AttributeID] ASC,
	[CategoryID] ASC,
	[AttributeValue] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [classified].[ClassifiedAdsAttributeValues]  WITH CHECK ADD  CONSTRAINT [FK_ClassifiedAdsAttributeValues_ClassifiedAttributeValues] FOREIGN KEY([CategoryID], [AttributeID], [AttributeValue])
REFERENCES [classified].[ClassifiedAttributeValues] ([CategoryID], [AttributeID], [AttributeValue])
GO

ALTER TABLE [classified].[ClassifiedAdsAttributeValues] CHECK CONSTRAINT [FK_ClassifiedAdsAttributeValues_ClassifiedAttributeValues]
GO


